//package com.example.workrecord.controller;
//
//import com.alibaba.fastjson.JSONObject;
//import com.example.workrecord.common.Page;
//import com.example.workrecord.config.WebLog;
//import com.example.workrecord.entity.CorpUserDetail;
//import com.example.workrecord.entity.Guest;
//import com.example.workrecord.exption.BizException;
//import com.example.workrecord.service.GuestService;
//import com.example.workrecord.util.Result;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import javax.servlet.http.HttpServletRequest;
//
///**
// * @ClassName GuestController
// * @Description GuestController
// * @Author Bu
// * @Date 2019/06/17 10:11
// * @Version 1.0
// */
//@RestController
//@Api(value = "guest", description = "议程管理端接口", consumes = "application/x-www-form-urlencoded")
//@RequestMapping(value = "/api/guest")
//public class GuestController extends BaseController {
//
//	@Autowired
//	private GuestService guestService;
//
//	@PostMapping("/save")
//	@ResponseBody
//	@WebLog(description = "新增Guest")
//	@ApiOperation(value = "新增Guest", notes = "{\"log\":\"公司log\",\"company_url\":\"公司头像\",\"company_name\":\"公司名称\",\"company_profile\":\"公司简介\",\"company_address\":\"公司地址\",\"company_mob\":\"公司联系电话\",\"type\":\"展商类型\",\"introduce_url\":\"介绍图片组\",\"introduce\":\"介绍\",\"case_url\":\"案例图片组\",\"case\":\"案例\",\"mien_url\":\"风采图片组\",\"mien\":\"风采\",\"status\":\"状态\",\"vnote1\":\"备注\",\"vnote2\":\"备注\",\"vnote3\":\"备注\"}")
//	public Result save(HttpServletRequest request, @RequestBody Guest form) {
//		try {
//			CorpUserDetail user = getUserInfo(request);
//			if(null == user || user.getUserid().equals("")){
//				return Result.error("用户信息未找到，请重新登陆");
//			}
//			form.setCreateUser(user.getName());
//			guestService.saveGuest(form);
//		}catch (Exception e){
//			return Result.error(e.getMessage());
//		}
//		return Result.success(form);
//	}
//
//
//	@PostMapping("/delete")
//	@ResponseBody
//	@WebLog(description = "根据id删除Guest")
//	@ApiOperation(value = "根据id删除Guest", notes = "{\\\"id\\\":\\\"id\\\"}")
//	public Result delete(HttpServletRequest request,@RequestBody JSONObject res) {
//		try {
//			CorpUserDetail user = getUserInfo(request);
//			if(null == user || user.getUserid().equals("")){
//				return Result.error("用户信息未找到，请重新登陆");
//			}
//			checkNull(res,"参数不可为空");
//			Integer id=res.getInteger("id");
//			guestService.deleteGuest(id);
//		}catch (Exception e){
//			return Result.error(e.getMessage());
//		}
//		return Result.success(null);
//	}
//
//	@PostMapping("/edit")
//	@ResponseBody
//	@WebLog(description = "修改Platform")
//	@ApiOperation(value = "修改Platform", notes = "{\"id\":\"id\",\"log_url\":\"log图\",\"name\":\"平台名称\",\"short_name\":\"平台简称\",\"units\":\"所在二级单位\",\"research_field\":\"研究领域\",\"industry\":\"行业\",\"link_name\":\"联系人名称\",\"link_mob\":\"联系手机号\",\"link_email\":\"联系邮箱\",\"introduce\":\"平台介绍\",\"research_data\":\"科研数据\",\"results\":\"成果展示数组\"}")
//	public Result edit(HttpServletRequest request, @RequestBody Guest guest) {
//		try {
//			CorpUserDetail user = getUserInfo(request);
//			if(null == user || user.getUserid().equals("")){
//				return Result.error("用户信息未找到，请重新登陆");
//			}
//			guestService.eidtGuest(guest);
//		}catch (Exception e){
//			return Result.error(e.getMessage());
//		}
//		return Result.success(guest);
//	}
//
//	@PostMapping("/list")
//	@ResponseBody
//	@WebLog(description = "分页查询Guest")
//	@ApiOperation(value = "分页查询Guest，根据条件查询", notes = "{\"userId\": \"用户id\",\"limit\": \"分页大小，此参数代表分页大小，最大100\",\"offset\": \"分页偏移，默认值：0\",\"startDate\": \"开始时间\",\"endDate\": \"结束时间\",\"searchDate\": \"搜索\"}")
//	public Result findUserByData(HttpServletRequest request, @RequestBody Guest vo ){
//		Page<Guest> page =new Page<>();
//		try{
//			CorpUserDetail user = getUserInfo(request);
//			if(null ==user ){
//				return Result.error("用户不可为空，请检查！");
//			}
//			checkNull(vo,"参数不可为空！");
//			page.setPageCurrent(vo.getOffset()+1);
//			page.setPageSize(vo.getLimit());
//			guestService.findGuestByData(vo,page);
//		}catch (BizException e){
//			return Result.error(e.getMessage());
//		}
//		return Result.success(page);
//	}
//
//	@PostMapping("/findById")
//	@ResponseBody
//	@WebLog(description = "根据Id查询Guest")
//	@ApiOperation(value = "根据Id查询Guest", notes = "{\"id\":\"id\"}")
//	public Result findById(HttpServletRequest request, @RequestBody JSONObject res ){
//		Guest guest=new Guest();
//		try{
//			CorpUserDetail user = getUserInfo(request);
//			if(null ==user ){
//				return Result.error("用户不可为空，请检查！");
//			}
//			checkNull(res,"参数不可为空");
//			Integer id=res.getInteger("id");
//			guest.setId(Long.valueOf(id));
//			guest=guestService.findGuestById(guest);
//		}catch (BizException e){
//			return Result.error(e.getMessage());
//		}
//		return Result.success(guest);
//	}
//
//}
